/*
 * @Author: january.cjy
 * @Date: 2021-09-27 16:54:22
 * @Last Modified by: january.cjy
 * @Last Modified time: 2021-09-28 17:19:16
 */
#pragma once

#include <string>
#include <unordered_set>
#include <vector>

#ifndef TRY_TO
#define TRY_TO(CACLL_EXPR)                                                     \
  do {                                                                         \
    if (!CALL_EXPR)                                                            \
      return false;                                                            \
  } while (false)
#endif

namespace util {
using namespace std;

string &join(vector<string> input, char x);
vector<string> &split(string &input, char x);

template <typename T> void RemoveRepetition(vector<T> &input) {
  unordered_set<T> pool;
  for (auto &i : input) {
    pool.insert(i);
  }
  input.clear();
  for(auto i:pool){
      input.emplace_back(i);
  }
  return;
}

}; // namespace util